package com.github.xuemingyu.springboot.acticitycloud.driver.dingtalk;

import com.dingtalk.api.response.OapiChatCreateResponse;
import com.dingtalk.api.response.OapiChatUpdateResponse;
import com.dingtalk.api.response.OapiDepartmentListResponse;
import com.dingtalk.api.response.OapiUserGetResponse;
import com.taobao.api.ApiException;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

public interface DingTalkService {
    /**
     * 获取access_token
     */
    String getAccessToken() throws ApiException;

    Map<String, String> loginByCode(String code) throws ApiException;

    Map<String, String> pcLogin(String code) throws ApiException;

    OapiUserGetResponse getUserInfoByUserId(String userId) throws ApiException;

    /**
     * 创建钉钉会话群
     *
     * @param name
     * @param userId
     * @return
     * @throws ApiException
     */
    OapiChatCreateResponse createConversation(String name, String userId, List<String> userList) throws ApiException;

    /**
     * 修改钉钉会话
     *
     * @param chatId
     * @param addUserId
     * @param delUserId
     * @return
     */
    OapiChatUpdateResponse updateConversation(String chatId, String addUserId, String delUserId) throws ApiException;

    /**
     * 获取部门列表
     *
     * @return
     */
    OapiDepartmentListResponse getDepartmentList() throws ApiException;

    String getParentDepts(String userId) throws ApiException;

    /**
     * 获取用户部门列表
     *
     * @return
     */
    List<Long> getUserDept(String userId) throws ApiException;


    String getDeptName(String userId) throws ApiException;

    /**
     * 获取活动范围部门名称
     * @param orgs
     * @return
     */
    String getActivityOrgs(String orgs) throws ApiException;
}
